# encoding: utf-8
"""

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    created by lei.chang on '11/04/2025'
    comment: 智能翻译抽象模型
"""
from pydantic import BaseModel, Field
from enum import Enum

from project.model import ResponseModel


class OutputFormat(Enum):
    """
    """
    json = 'json'
    word = 'word'


class Word(BaseModel):
    """ 单词
    """
    english: str
    chinese: str
    explanation: str


class Sentence(BaseModel):
    """ 短句
    """
    english: str
    chinese: str


class Translation(BaseModel):
    """ 大模型输出的翻译结果
    """
    bilingual: list[Sentence]
    vocabulary: list[Word]


@ResponseModel
class ApiTranslate(BaseModel):
    """
    """
    translation: str = Field('', title='翻译中文内容')
    vocabulary: list[Word] | None = Field(None, title='词汇列表')
    word_document_url: str | None = Field(None, title='word链接')


class Conversation(BaseModel):
    """
    """
    message: str = Field('', title='用户输入')
    reply: str = Field('', title='AI回复')
    duration: int = Field(0, title='推理时长', description='单位: 秒')


@ResponseModel
class ApiConversation(BaseModel):
    """
    """
    conversations: list[Conversation] | None = Field([], title='AI话术列表')


if __name__ == "__main__":
    """
    """
    pass

